package com.itheima.a01mathdemo1;

public class MathDemo1 {
    public static void main(String[] args) {

        //abs 获取参数的绝对值
        System.out.println(Math.abs(-10));
        //ceil 向上取整
        System.out.println(Math.ceil(3.1));
        //floor 向下取整
        System.out.println(Math.floor(3.1));
        //round 四舍五入
        System.out.println(Math.round(3.1));

        //获取两个数的最大值
        System.out.println(Math.max(10, 20));
        //获取两个数的最小值
        System.out.println(Math.min(10, 20));

        //获取随机数
        System.out.println(Math.random());
        //a的b次幂
        System.out.println(Math.pow(2, 3));

        //开根号
        System.out.println(Math.sqrt(9));
        //开立方
        System.out.println(Math.cbrt(27));
    }
    
}
